<%@ page language="java" contentType="text/html; charset=UTF-8"
  pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
<title>陆老师小课堂</title>
<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>
</head>
<!-- end header -->

<body>
  <div class="page-group">
    <div class="page page-current bg-light-gray">
      <div class="content">
        <header class="bar bar-nav dark-header">
          <a href="${ctx.host}/home" class="icon icon-left pull-left"></a>
          <h1 class="title">测试报告</h1>
        </header>
        <div class="content" style="background-color: #FFF">
          
          <div class="card no-margin">
            <div class="card-header">${oralAnswerRecord.oralRound.name}</div>
            <div class="card-content">
              <div class="card-content-inner">${oralAnswerRecord.oralRound.description}</div>
            </div>
          </div>
          
          <div class="card record-stat no-margin">
            <div class="card-header clearfix">
              <div class="clearfix" style="width: 100%;">
              测试统计
              <div class="star-group">
                <c:forEach begin="1" end="3" varStatus="status">
                  <i class="star ${status.index <= oralAnswerRecord.stars ? 'active' : ''}"></i>
                </c:forEach>
              </div>
              </div>
            </div>
            <div class="card-content">
              <div class="card-content-inner" style="line-height: 1.1rem; text-align: center;">
                共&nbsp;<small>${oralAnswerRecord.success + oralAnswerRecord.fail}</small>&nbsp;题，用时&nbsp;<small>${oralAnswerRecord.seconds}</small>&nbsp;秒。<br>
                熟练&nbsp;<small>${oralAnswerRecord.success}</small>&nbsp;题，不熟练&nbsp;<small>${oralAnswerRecord.fail}</small>&nbsp;题。<br>
                触碰分支&nbsp;<small>${oralAnswerRecord.branches}</small>&nbsp;处
              </div>
            </div>
          </div>
          
          <div class="card no-margin" style="margin-left: 0px; margin-right: 0px;">
            <div class="card-header" >详细分析</div>
            <div class="card-content">
              <div class="card-content-inner">
                <ul class="question-records">
                  <c:set var="branch" value="false"></c:set>
                  <c:forEach var="question" items="${result.questionResults}">
                    <c:if test="${question.branchStart}">
                      <c:set var="branch" value="true"></c:set>
                    </c:if>
                    <c:if test="${question.branchEnd}">
                      <c:set var="branch" value="false"></c:set>
                    </c:if>
                    <li class="${branch ? 'branch' : ''} clearfix">
                      <p class="pull-left question">${question.value}</p>
                      <p class="${question.state ? 'success' : 'fail'} pull-right result">${question.state ? '熟练' : '不熟练'}</p>
                    </li>
                  </c:forEach>
                </ul>
              </div>
            </div>
          </div>
          
        </div>
      </div>
    </div>
  </div>
  
  
  <%@ include file="/WEB-INF/include/script.jsp"%>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/oral/report.js" />
  <script type="text/javascript">
      var stars = "${oralAnswerRecord.stars}";
      require(['page/oral/report'], function(page) {
        page.init({
          'jsConfig': JSON.parse('${jsConfig}'),
          'stars': stars
        });
      })
  </script>
  
</body>
</html>